package comclass;

public class Student {
//    加入private 别人访问不到---封装
//    todo 属性私有是为了保护数据安全-------------set  get
    public  int sno;
    private String name;
    private int age;
    private String gender;
    private int score;

    //空构造器

    /**
     * 空构造器
     * 如果生成有参构造器之前   必须生成一个无参空构造器--避免很多错误
     * */
    public Student() {
    }

    /**
     *
     * 有参构造器--同样快捷方式
     * */
    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    //todo 摁住 alt+ins键出来---快捷设置  get and  set
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public void sayHell(){

    }
}
